package com.quality.web.server.misc;

import org.apache.log4j.Logger;

public class ServerLogger {

  private static final Logger logger = Logger.getLogger(ServerLogger.class);

  public static void info(String message) {
    System.out.println(message);
    logger.info(message);
  }

  public static void error(String message) {
    System.err.println(message);
    logger.error(message);
  }

  public static void timing(String operation, long start, long end) {
    String msgTime = operation + " - " + (end - start) + "ms";
    System.out.println(msgTime);
    logger.info(msgTime);
  }

  public static void error(String message, Exception e) {
    logger.error(message, e);
    System.err.println(message);
  }

}
